/**
 * 
 */
package com.wubo.sec.acl.core;

/**
 * <h3>适用于实体类的ACL适配器</h3>
 * <p>默认允许增删查改四个权限，子类可以覆盖此行为</p>
 * <p>子类修改默认权限时，只需重写getAcl方法，isAllow*方法将会自动计算</p>
 * @author WuBo
 * @CreateDate 2012-4-23
 */
public abstract class EntityAcl extends LocalAcl {
	
	public boolean isAllowAdd() {
		return AclManager.getInstance().hasActions(getAcl(), "ACL_ADD");
	}

	public boolean isAllowDel() {
		return AclManager.getInstance().hasActions(getAcl(), "ACL_DEL");
	}

	public boolean isAllowGet() {
		return AclManager.getInstance().hasActions(getAcl(), "ACL_GET");
	}

	public boolean isAllowPut() {
		return AclManager.getInstance().hasActions(getAcl(), "ACL_PUT");
	}
}
